package org.jeecg.modules.tankerBlack.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.jeecg.modules.tankerBlack.entity.TankerBlack;
import org.jeecg.modules.tankerBlack.mapper.TankerBlackMapper;
import org.jeecg.modules.tankerBlack.service.ITankerBlackService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 油罐车黑名单
 * @Author: jeecg-boot
 * @Date:   2024-07-21
 * @Version: V1.0
 */
@Service
public class TankerBlackServiceImpl extends ServiceImpl<TankerBlackMapper, TankerBlack> implements ITankerBlackService {

    @Override
    public TankerBlack getByPlateOrTrailerNo(String plate, String trailerNo) {
        LambdaQueryWrapper<TankerBlack> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(TankerBlack::getPlate, plate).or(w -> w.eq(TankerBlack::getPlate, trailerNo));
        return baseMapper.selectOne(wrapper);
    }
}
